<?php

class my_order_update{
public function index(){
$id = intval($GLOBALS['request']['order_id']);
if(empty($id)){
$root['info']='订单号不存在，请重新登入！';
$root['return']=0;
output($root);
}
$root = array();
$root['return'] = 1;
$root['user_login_status'] = 1;
$order_nums = intval($GLOBALS['request']['nums']);
$order_time = $GLOBALS['request']['time'];
$seat_status = trim(intval($GLOBALS['request']['seat']));
$order_tel = trim($GLOBALS['request']['tel']);
$order_name= trim($GLOBALS['request']['name']);
$order_sex = trim($GLOBALS['request']['sex']);
$order_msg= htmlspecialchars(addslashes(trim($GLOBALS['request']['msg'])));
if(empty($order_tel)){
$root['info']='您好，我们需要知道您的手机号以方便联系您!';
$root['return']=0;
output($root);
}
elseif(!check_mobile($order_tel)){
$root['info']='您好，您的手机号格式不正确!';
$root['return']=0;
output($root);
}
if(empty($order_name)){
$root['info']='您好，我们需要知道您的姓名!';
$root['return']=0;
output($root);
}
$sql = 'update '.DB_PREFIX."supplier_location_order set order_name='{$order_name}',order_time='{$order_time}',order_nums='{$order_nums}',seat_status='{$seat_status}',order_tel='{$order_tel}',order_name='{$order_name}',order_sex='{$order_sex}',order_msg='{$order_msg}' where  id = '{$id}' ";
$GLOBALS['db']->query($sql);
$rs = $GLOBALS['db']->affected_rows();
if($rs <=0 ){
$root['info']='更新失败，请联系管理员!';
$root['return']=0;
output($root);
}
$root['return']=1;
$root['info']='修改成功！';
output($root);
}
}
?>